package com.dm.saleassback.assessmanage.controller;

import com.dm.saleassback.assessmanage.service.AssessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@Transactional
@CrossOrigin
public class AssessController {
    @Autowired
    private AssessService assessService;

    /**
         * @Description 查询考核信息
         * @Author zhangxue
         * @Date 16:56 2018/5/31
         * @Param
         * @retrun
         **/
    @RequestMapping(value="/queryAllAssess",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> queryAllAssess(@RequestBody Map<String,Object> param){
        Map<String,Object> statusMap = assessService.queryAllAssess(param);
        return statusMap;
    }


    /**
     * @Description 新增考核信息
     * @Author zhangxue
     * @Date 15:05 2018/6/1
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/saveAssess",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> saveAssess(@RequestBody Map<String,Object> param){
        Map<String,Object> statusMap = assessService.saveAssess(param);
        return statusMap;
    }

    /**
     * @Description 删除考核信息
     * @Author zhangxue
     * @Date 15:06 2018/6/1
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/deleteAssessById",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> deleteAssessById(@RequestBody Map<String,Object> param){
        Map<String,Object> statusMap = assessService.deleteAssessById(param);
        return statusMap;
    }

    /**
     * @Description 修改考核信息
     * @Author zhangxue
     * @Date 15:09 2018/6/1
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/updateAssessById",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> updateAssessById(@RequestBody Map<String,Object> param){
        Map<String,Object> statusMap = assessService.updateAssessById(param);
        return statusMap;
    }

    /**
     * @Description 考核录入---类别查询
     * @Author zhangxue
     * @Date 15:53 2018/6/5
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/queryAccessCategory",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> queryAccessCategory(@RequestBody Map<String,Object> param){
        Map<String,Object> statusMap = assessService.queryAccessCategory(param);
        return statusMap;
    }

    /**
     * @Description 考核录入---项目查询
     * @Author zhangxue
     * @Date 15:53 2018/6/5
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/queryAccessProject",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> queryAccessProject(@RequestBody Map<String,Object> param){
        Map<String,Object> statusMap = assessService.queryAccessProject(param);
        return statusMap;
    }

    /**
     * @Description 考核录入---岗位标准查询
     * @Author zhangxue
     * @Date 15:53 2018/6/5
     * @Param
     * @retrun
     **/
        @RequestMapping(value="/queryAccessStandard",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
        @ResponseBody
        public Map<String,Object> queryAccessStandard(@RequestBody Map<String,Object> param){
            Map<String,Object> statusMap = assessService.queryAccessStandard(param);
            return statusMap;
        }

        /**
             * @Description 导出Excel
             * @Author zhangxue
             * @Date 14:55 2018/6/14
             * @Param
             * @retrun
             **/
        @RequestMapping(value="/CreateAssessExcel",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
        @ResponseBody
        public Map<String,Object> CreateAssessExcel(@RequestBody Map<String,Object> param){
            Map<String,Object> statusMap = assessService.CreateAssessExcel(param);
            return statusMap;
        }

}
